package com.zh.sharding.sale.entity;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;

/**
 * 订单：
 * no 使用分布式ID
 * 分片规则：按ID分片
 * @author ZH
 * @date 09:16 2023/8/4
 */
@Data
public class MyOrders implements Serializable {
    /**
     * 使用分布式ID
     */
    private String no;
    private Integer num;
    private BigDecimal amount;
    private Long productId;
    private Long userId;

    private LocalDateTime createTime;

    public MyOrders(){}
    public MyOrders(Long productId, Integer num, Long userId){
        this.productId = productId;
        this.num = num;
        this.userId = userId;
        this.createTime = LocalDateTime.now();
    }



}
